package com.eclink.utils;

import java.text.SimpleDateFormat;
import java.util.Date;

public class Log {
  private static boolean enable = false;
  
  public static void set_enable(boolean enable) {
    Log.enable = enable;
  }
  
  public static void d(String tag, String msg) {
    if (enable) {
      System.out.println("[" + (new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"))
          .format(new Date()) + "] [" + tag + "] " + msg);
    }
  }
  
  public static void e(String tag, String msg) {
    if (enable)
      System.out.println("\033[31m[" + (new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"))
          .format(new Date()) + "] [" + tag + "] " + msg + "\033[0m"); 
  }
}


/* Location:              E:\code\work\eclink\eclink-iot-tcp-server\backend\libs\eclink-iot.jar!\com\eclin\\utils\Log.class
 * Java compiler version: 8 (52.0)
 * JD-Core Version:       1.1.3
 */